package com.qing.api.service;

import com.qing.api.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(value = "springcloud-provider-user",fallbackFactory=UserClientServiceFallbackFactory.class)
public interface UserClientService {

    @PostMapping("/user")
    void addUse(@RequestBody User user);

    @GetMapping("/user/{id}")
    User queryById(@PathVariable("id")   Long id);

    @GetMapping("/user/list")
    List<User> queryUser(@RequestParam(value = "name") String name);

}
